<?php if(!defined('A')) exit;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<?php
loadjs(array('common','jquery'),P_JS);
?>
<script>
$(document).ready(function(){
	var islogin=get_cookie('islogin');
	$('#fav').click(function(){
		if(islogin){
			$.post('<?php echo url('arc','favorite');?>',{'id':$(this).attr('title')},function(data){
					var code=parseInt(data.code);
					if(code<=0){
						alert(data.msg);
						if(code==-2){
							//登陆
							window.open('http://www.qsbdc.com/');
						}
						return;
					}else{
						alert(data.msg);	
					}
			},'json');	
		}else{
			alert('请先登陆！');	
			window.open('http://www.qsbdc.com/');
			return;
		}
	});
});
</script>
</head>
<body>
<a href="###" id="fav" title="7" >加入收藏</a>
</body>
</html>